//storkeTower.cpp

#include <math.h>
#include <stdio.h>

#include "storkeTower.h"

//Object's default constructor. Initializes all of the object's private variables.
storkeTower::storkeTower()
{
  loc.x = 0;
  loc.y=0;
  lives =5;
}

//This function checks to see if an enemy object is within range of this object. An object of the enemy class is sent in to the function and a boolean is returned. It returns true if the enemy object is within range, and false otherwise.
bool storkeTower::check_range(enemy *badguy)
{
  if(badguy->getCoordinates().x==this->loc.x && badguy->getCoordinates().y==this->loc.y)
    {
      this->lives = this->lives - 1;
      return true;
    }
  return false;
}

//This function returns the x,y pair location of the object.
pair storkeTower::getLoc()
{
  return loc;
}

//This function takes an x,y pair and changes the object's x,y location to the x,y pair that was passed in.
void storkeTower::setLoc(pair p)
{
  loc.x = p.x;
  loc.y = p.y;
}

//This function returns the number of lives the object has.
int storkeTower::getLives(){
  return lives;
}

//This function takes an integer and changes the object's lives variable to the integer that was passed in.
void storkeTower::setLives(int life)
{
  lives = life;
}

void storkeTower::decrementLives()
{
  lives = lives - 1;
}

//This is the object's destructor.
storkeTower::~storkeTower()
{
}
